/**
 * TO BE DETERMINED
 */
package org.eichar.server.service;

import org.eichar.client.shared.ServiceCommunicationConstants;

/**
 * The types of questions that can be requested from the {@link QuestionService}.
 * 
 * @author Jesse
 */
public enum QuestionType {

    RANDOM(ServiceCommunicationConstants.QUERY_VALUE_RANDOM_QUESTION), TRANSLATION(
            ServiceCommunicationConstants.VALUE_TRANSLATION_QUESTION);

    private final String stringValue;

    private QuestionType(String value) {
        this.stringValue = value;
    }

    public static QuestionType value(String valueToMatch) {
        QuestionType[] values = values();

        for (QuestionType type : values) {
            if (valueToMatch.equals(type.stringValue))
                return type;
        }

        throw new IllegalArgumentException(valueToMatch
                + " is not a known QuestionType"); //$NON-NLS-1$

    }
}
